<template>
  <div>
    <div>1111</div>
    <div id="test2">2222</div>
  </div>
</template>

<script>
import { registerMicroApps, start } from 'qiankun'
//
// registerMicroApps([
//   {
//     name: 'goview',
//     // entry: 'http://localhost:3000',
//     entry: {
//       scripts:[],
//       // styles? : string[],
//       html: `<div id="test2">3333</div>`
//     },
//     container: '#test2',
//     activeRule: '/test',
//   }
// ]);
//
// start();

import { loadMicroApp } from 'qiankun'

loadMicroApp({
  name: 'goview',
  entry: '//localhost:3000',
  container: '#test2'
})

export default {
  name: 'test.vue',
  mounted() {
    if (!window.qiankunStarted) {
      window.qiankunStarted = true
      // registerApps()
      start({
        sandbox: {
          experimentalStyleIsolation: true // 样式隔离
        }
      })
    }
  }
}
</script>

<style scoped></style>
